package com.moyuaninfo.factory;

import org.springframework.data.jpa.domain.Specification;

/**
 * 条件构造器工厂类
 *
 * @author 邱祥霸
 * @date 2020-04-08
 */
public class QueryFactory {
    public static <T> Specification<T> equal(String attribute, String value) {
        return (Specification<T>) (root, criteriaQuery, criteriaBuilder) -> criteriaBuilder.equal(root.get(attribute), value);
    }

}
